# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
pkgname=clanlib
pkgver=4.1.0
pkgrel=2
pkgdesc="A multi-platform game development library."
arch=('loong64' 'x86_64')
url="https://github.com/sphair/ClanLib"
license=('custom:zlib')
depends=('alsa-lib' 'fontconfig' 'libgl' 'libxrender')
makedepends=('doxygen' 'graphviz')
source=($pkgname-$pkgver.tar.gz::https://github.com/sphair/ClanLib/archive/v${pkgver}.tar.gz)
sha512sums=('34f5d1fdb7b071a218f081a6b06a6018a9c20cedc4c8500a9796be02d335f06fa148304379eeb1a35e08b9a734e504ceb490a6558a43d1611187bd97be01f4b0')

build() {
	cd ClanLib-$pkgver

	./autogen.sh
	./configure --prefix=/usr

  # Prevent overlinking
	sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

	make
	make html
}

package() {
	cd ClanLib-$pkgver

	make DESTDIR="$pkgdir" install
	make DESTDIR="$pkgdir" install-html

	install -d "$pkgdir"/usr/share/licenses/$pkgname
	install -m644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim: sw=2:ts=2 et:
